package com.yy.wga.order.service.api.response;

import com.alibaba.fastjson.annotation.JSONField;
import com.yy.wga.mp.common.dto.BaseApiDTO;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;

@EqualsAndHashCode(callSuper = true)
@Data
public class OrderInfoResp extends BaseApiDTO implements Serializable {

    @JSONField(name = "commssion_order")
    private CommssionOrderInfo commssionOrder;


    @Data
    public static class CommssionOrderInfo {
        /**
         * 订单号
         */
        @JSONField(name = "order_id")
        private String orderId;

        /**
         * 商品skuid
         */
        @JSONField(name = "sku_id")
        private String skuId;

        /**
         * 秒级时间戳
         */
        @JSONField(name = "create_time")
        private Long createTime;

        /**
         * 秒级时间戳
         */
        @JSONField(name = "update_time")
        private Long updateTime;

        /**
         * 枚举值	描述
         * 20	未结算
         * 100	已结算
         * 200	取消结算
         */
        @JSONField(name = "status")
        private int status;

        @JSONField(name = "order_detail")
        private OrderDetail orderDetail;

    }

    @Data
    public static class OrderDetail {
        /**
         * 小店商家信息
         */
        @JSONField(name = "shop_info")
        private ShopInfo shopInfo;


        /**
         * 佣金单商品信息
         */
        @JSONField(name = "product_info")
        private ProductInfo productInfo;

        /**
         * 订单信息
         */
        @JSONField(name = "order_info")
        private OrderInfo orderInfo;


        /**
         * 分佣信息
         */
        @JSONField(name = "commission_info")
        private CommissionInfo commissionInfo;


        @JSONField(name = "buyer_info")
        private Buyer buyerInfo;

    }

    @Data
    public static class OrderInfo {
        /**
         * 枚举值	描述
         * 10	待付款
         * 20	待发货
         * 21	部分发货
         * 30	待收货
         * 100	完成
         * 200	全部商品售后之后，订单取消
         * 250	未付款用户主动取消或超时未付款订单自动取消
         */
        @JSONField(name = "order_status")
        private Integer orderStatus;
    }

    @Data
    public static class ShopInfo {
        /**
         * 所属小店appid
         */
        @JSONField(name = "appid")
        private String appid;
    }

    @Data
    public static class ProductInfo {
        /**
         * 商品id
         */
        @JSONField(name = "product_id")
        private String productId;

        /**
         * 	sku小图
         */
        @JSONField(name = "thumb_img")
        private String thumbImg;

        /**
         * 商品标题
         */
        @JSONField(name = "title")
        private String title;

        /**
         * 可分佣金额
         */
        @JSONField(name = "actual_payment")
        private Integer actualPayment;
    }

    @Data
    public static class CommissionInfo {
        @JSONField(name = "service_ratio")
        private Integer serviceRatio;

        /**
         * 服务费金额
         */
        @JSONField(name = "service_amount")
        private Integer serviceAmount;

        /**
         * 服务费结算时间
         */
        @JSONField(name = "profit_sharing_suc_time")
        private Long profitSharingSucTime;

        /**
         * 带货达人信息，结构体详情请参考
         */
        @JSONField(name = "finder_info")
        private FinderInfo finderInfo;

        /**
         * 服务费率[0, 1000000]
         */
        @JSONField(name = "sharer_info")
        private SharerInfo sharerInfo;

    }

    @Data
    public static class FinderInfo {
        /**
         * 达人昵称
         */
        @JSONField(name = "finder_id")
        private String finderId;

        @JSONField(name = "nickname")
        private String nickname;

        /**
         * 佣金率[0, 1000000]
         */
        @JSONField(name = "ratio")
        private Integer ratio;

        /**
         * 佣金
         */
        @JSONField(name = "amount")
        private Integer amount;

        /**
         * 视频号openfinderid
         */
        @JSONField(name = "openfinderid")
        private String openFinderId;
    }

    @Data
    public static class SharerInfo {
        @JSONField(name = "sharer_appid")
        private String sharerAppId;

        @JSONField(name = "nickname")
        private String nickname;

        @JSONField(name = "ratio")
        private Integer ratio;

        @JSONField(name = "amount")
        private Integer amount;

        @JSONField(name = "opensharerid")
        private String openSharerId;
    }

    @Data
    public static class Buyer {
        /**
         * 购买者openId
         */
        @JSONField(name = "open_id")
        private String openId;

        /**
         * 购买者unionId
         */
        @JSONField(name = "union_id")
        private String unionId;
    }
}